package com.szq.pattern.visitor;

import com.szq.pattern.user.Student;
import com.szq.pattern.user.Teacher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @description: 家长视角
 * @author: szq
 * @date: 2021-09-11 08:57:41
 */
public class Parent implements Visitor{

    private Logger logger = LoggerFactory.getLogger(Parent.class);

    @Override
    public void visit(Student student) {
        logger.info("学生信息 姓名：{}，排名：{}", student.getName(), student.ranking());
    }

    @Override
    public void visit(Teacher teacher) {
        logger.info("教师信息 姓名：{}， 级别：{}", teacher.getName(), teacher.getIdentity());
    }
}
